package com.derbysoft.synxisadapter.commons.log;

import com.derbysoft.synxisadapter.commons.model.TransactionLog;

import java.util.Set;

/**
 * Created by: jason
 * Date: 2012-08-29
 */
public abstract class TransactionLogger {
    private static ThreadLocal<TransactionLog> transactionLogger = new ThreadLocal<TransactionLog>();
    private static ThreadLocal<ReservationPair> reservationLogger = new ThreadLocal<ReservationPair>();
    private static ThreadLocal<Set<LogDetailPair>> logDetails = new ThreadLocal<Set<LogDetailPair>>();

    public static void cleanLogDetails() {
        logDetails.remove();
    }

    public static void cleanAvailLogger() {
        transactionLogger.remove();
    }

    public static ThreadLocal<Set<LogDetailPair>> getLogDetails() {
        return logDetails;
    }

    public static ThreadLocal<TransactionLog> getTransactionLogger() {
        return transactionLogger;
    }

    public static ThreadLocal<ReservationPair> getReservationLogger() {
        return reservationLogger;
    }

    public static void cleanReservationLogger() {
        reservationLogger.remove();
    }
}
